﻿using WeDonekRpc.Helper;
using WeDonekRpc.Model;

namespace Basic.WxApiRemoteModel.WxFilter.Model
{
    public class ReplySet : IEquatable<ReplySet>
    {
        /// <summary>
        /// 是否同步启动同步锁(解决客户端重复提交问题)
        /// </summary>
        public bool? IsEnableLock { get; set; }


        /// <summary>
        /// 是否允许重试
        /// </summary>
        public bool? IsAllowRetry
        {
            get;
            set;
        }
        /// <summary>
        /// 重试数
        /// </summary>
        public int? RetryNum { get; set; }
        /// <summary>
        /// 发送超时时间
        /// </summary>
        public int? TimeOut { get; set; }

        /// <summary>
        /// 负载均衡的计算方式
        /// </summary>
        public TransmitType? TransmitType
        {
            get;
            set;
        }
        /// <summary>
        /// 负载均衡的列
        /// </summary>
        public string Transmit { get; set; }
        /// <summary>
        /// 用于负载均衡计算的字段名(默认 MsgId )支持的有：WxAppId ,WxUserOpenId 和MsgId
        /// </summary>
        public string TransmitKey
        {
            get;
            set;
        }
        /// <summary>
        /// 是否选择唯一的服务器进行广播
        /// </summary>
        public bool? IsOnly { get; set; }
        /// <summary>
        /// 广播方式
        /// </summary>
        public BroadcastType? BroadcastType
        {
            get;
            set;
        }
        public int? RegionId { get; set; }


        public override bool Equals (object? obj)
        {
            if (obj is ReplySet i)
            {
                return this.IsEquals<ReplySet>(i);
            }
            return false;
        }

        public bool Equals (ReplySet? other)
        {
            if (other != null)
            {
                return this.IsEquals<ReplySet>(other);
            }
            return false;
        }

        public override int GetHashCode ()
        {
            return base.GetHashCode();
        }
    }
}
